#pragma once
#include <d3d9.h>
#include <d3dx9.h>

#pragma comment(lib,"d3d9.lib")
#pragma comment(lib,"d3dx9.lib")

#define BOUND_FVF D3DFVF_XYZ | D3DFVF_DIFFUSE

class cBoundingPolyhedron
{
public:
	cBoundingPolyhedron(){
	}
	virtual void Draw(LPDIRECT3DDEVICE9 pDevice){}
	virtual void ComputeBounding(){}
};

class cBoundingBox:public cBoundingPolyhedron
{
public:
	cBoundingBox(){
	}
	void Draw(LPDIRECT3DDEVICE9 pDevice);
	void ComputeBounding(LPD3DXMESH pMesh);
	D3DXVECTOR3 GetMaxPoint(){return m_vecMaxPt;}
	D3DXVECTOR3 GetMinPoint(){return m_vecMinPt;}
	void AddPoint(D3DXVECTOR3& v);
private:
	D3DXVECTOR3 m_vecMaxPt;
	D3DXVECTOR3 m_vecMinPt;
	D3DXVECTOR3 m_vecCenterPt;
};